package com.bluesky.jwf.config;

public class ComponentInfo {

	private String className;
	private TemplateResourceInfo templateResourceInfo;

	public ComponentInfo() {
		templateResourceInfo = new TemplateResourceInfo();
	}

	/**
	 * eg. com.abc.Button,foo.html@button
	 * 
	 * @param s
	 */
	public void load(String s, String defaultTemplate) {
		String[] ss = s.split(",");
		className = ss[0];

		templateResourceInfo = new TemplateResourceInfo();
		if (ss.length >= 2) {

			templateResourceInfo.load(ss[1], defaultTemplate);

		}

	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public TemplateResourceInfo getTemplateResourceInfo() {
		return templateResourceInfo;
	}

	public void setTemplateResourceInfo(
			TemplateResourceInfo templateResourceInfo) {
		this.templateResourceInfo = templateResourceInfo;
	}

}
